<meta charset="utf-8">
<button onclick="fun1()">1</button>
<button onclick="fun2()">2</button>
<button onclick="fun3()">3</button>
<button onclick="fun4()">4</button>
<button onclick="fun5()">5</button>
<button onclick="last()">上一个</button>
<button onclick="next()">下一个</button>
<button onclick="fangda()">放大</button>
<button onclick="suoxiao()">缩小</button>
<hr />
<img id="pid" src="1.jpg">
<script>
var i=1;
function fun1(){
      pid.src="1.jpg";
      i=1;
}
function fun2(){
      pid.src="2.jpg";
      i=2;
}
function fun3(){
      pid.src="3.jpg";
      i=3;
}
function fun4(){
      pid.src="4.jpg";
      i=4;
}
function fun5(){
      pid.src="5.jpg";
      i=5;
}
function last(){
      i--;
      if(i==0){
          i=5;
}
      pid.src=i+".jpg";
}
function next(){
      i++;
      if(i==6){
         i=1;
      }
      pid.src=i+".jpg";
}
function fangda(){
pid.width=pid.width*1.1;
}
function suoxiao(){
pid.width=pid.width*0.9;
}
setInterval(next,3000);
</script>